﻿@model MvcValidateDemo.Models.UserInfo

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Add</title>
    <script src="~/Scripts/jquery-1.8.2.js"></script>
    <script src="~/Scripts/jquery.validate.js"></script>
    <script src="~/Scripts/jquery.validate.unobtrusive.js"></script>
</head>
    <body>
        
        @{
            Html.EnableClientValidation(false);
        }
        
        @using (Html.BeginForm()) {
            @Html.AntiForgeryToken()
            @Html.ValidationSummary(true)
    
            <fieldset>
                <legend>UserInfo</legend>
    
                <div class="editor-label">
                    @Html.LabelFor(model => model.UserName)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.UserName)
                    @Html.ValidationMessageFor(model => model.UserName)
                </div>
    
                <div class="editor-label">
                    @Html.LabelFor(model => model.Age)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Age)
                    @Html.ValidationMessageFor(model => model.Age)
                </div>
    
                <p>
                    <input type="submit" value="注册" />
                </p>
            </fieldset>
        }
    
        <div>
            @Html.ActionLink("Back to List", "Index")
        </div>
    </body>
</html>
